/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * halamanUtamaKaryawan.java
 *
 * Created on Oct 1, 2011, 1:06:08 AM
 */
package rentalmobil.gui;

import java.util.logging.Level;
import java.util.logging.Logger;
import java.sql.SQLException;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import rentalmobil.Help.FormBantuanKaryawan;

/**
 *
 * @author Henfryandie
 */
public class halamanUtamaKaryawan extends javax.swing.JFrame {

    halamanUtamaKaryawan mw;

    /** Creates new form halamanUtamaKaryawan */
    public halamanUtamaKaryawan() {
        super("Menu Utama Karyawan");
        initComponents();
        setLocationRelativeTo(null);
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane1 = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenuFile = new javax.swing.JMenu();
        jMenuItemKeluar = new javax.swing.JMenuItem();
        jMenuTransaksi = new javax.swing.JMenu();
        jMenuItemTransaksiSewa = new javax.swing.JMenuItem();
        jMenuItemTransaksiKembali = new javax.swing.JMenuItem();
        jMenu4 = new javax.swing.JMenu();
        jMenuItemkBantuan = new javax.swing.JMenuItem();
        jMenuItemTutorial = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jDesktopPane1.setBackground(new java.awt.Color(204, 255, 204));

        jMenuBar1.setBackground(new java.awt.Color(204, 255, 204));

        jMenuFile.setBackground(new java.awt.Color(204, 255, 204));
        jMenuFile.setText("File");

        jMenuItemKeluar.setText("Keluar");
        jMenuItemKeluar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemKeluarActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuItemKeluar);

        jMenuBar1.add(jMenuFile);

        jMenuTransaksi.setBackground(new java.awt.Color(204, 255, 204));
        jMenuTransaksi.setText("Transaksi");

        jMenuItemTransaksiSewa.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItemTransaksiSewa.setText("Transaksi Sewa");
        jMenuItemTransaksiSewa.setToolTipText("Transaksi Sewa");
        jMenuItemTransaksiSewa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemTransaksiSewaActionPerformed(evt);
            }
        });
        jMenuTransaksi.add(jMenuItemTransaksiSewa);

        jMenuItemTransaksiKembali.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItemTransaksiKembali.setText("Transaksi Kembali");
        jMenuItemTransaksiKembali.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemTransaksiKembaliActionPerformed(evt);
            }
        });
        jMenuTransaksi.add(jMenuItemTransaksiKembali);

        jMenuBar1.add(jMenuTransaksi);

        jMenu4.setBackground(new java.awt.Color(204, 255, 204));
        jMenu4.setText("Bantuan");
        jMenu4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu4ActionPerformed(evt);
            }
        });

        jMenuItemkBantuan.setText("About");
        jMenuItemkBantuan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemkBantuanActionPerformed(evt);
            }
        });
        jMenu4.add(jMenuItemkBantuan);

        jMenuItemTutorial.setText("Tutorial");
        jMenu4.add(jMenuItemTutorial);

        jMenuBar1.add(jMenu4);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 766, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 766, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 414, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jDesktopPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 414, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItemKeluarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemKeluarActionPerformed
        // TODO add your handling code here:
        if (JOptionPane.showConfirmDialog(this, "Apakah anda yakin untuk logout", "konfirmasi", JOptionPane.YES_NO_OPTION) == 0) {
            try {
                new formLogin().setVisible(true);
                this.dispose();
            } catch (Exception ex) {
                Logger.getLogger(formLogin.class.getName()).log(Level.SEVERE, null, ex);
            }

        }
    }//GEN-LAST:event_jMenuItemKeluarActionPerformed

    private void jMenuItemTransaksiSewaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTransaksiSewaActionPerformed
        try {
            new formTransaksiSewa(this, true).setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(halamanUtamaKaryawan.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jMenuItemTransaksiSewaActionPerformed

    private void jMenuItemTransaksiKembaliActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemTransaksiKembaliActionPerformed
        try {
            new catatTransaksiKembali(this, true).setVisible(true);
        } catch (SQLException ex) {
            Logger.getLogger(halamanUtamaKaryawan.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jMenuItemTransaksiKembaliActionPerformed

    private void jMenuItemkBantuanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemkBantuanActionPerformed
        FormBantuanKaryawan iBantuan = new FormBantuanKaryawan();
        jDesktopPane1.add(iBantuan);
        iBantuan.setVisible(true);
    }//GEN-LAST:event_jMenuItemkBantuanActionPerformed

    private void jMenu4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenu4ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                halamanUtamaKaryawan huk = new halamanUtamaKaryawan();
                huk.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenu jMenuFile;
    private javax.swing.JMenuItem jMenuItemKeluar;
    private javax.swing.JMenuItem jMenuItemTransaksiKembali;
    private javax.swing.JMenuItem jMenuItemTransaksiSewa;
    private javax.swing.JMenuItem jMenuItemTutorial;
    private javax.swing.JMenuItem jMenuItemkBantuan;
    private javax.swing.JMenu jMenuTransaksi;
    // End of variables declaration//GEN-END:variables
}
